<?php
class PostCreateForm extends MForm {
    public function __construct() {
        parent::__construct(__route('ml-admin', array('module'=>'ml-blog/post/create')));
        $this->setMethod(self::METHOD_POST);

        $this->add(self::ELEMENT_TEXT, 'postTitle')
                ->setLabel(__t('mandrill.blog.admin.post.form.title'));
        $this->add(self::ELEMENT_TEXTAREA, 'postContent')
                ->setLabel(__t('mandrill.blog.admin.post.form.content'));
        $select = $this->add(self::ELEMENT_SELECT, 'postStatus')
                ->setLabel(__t('mandrill.blog.admin.post.form.status'));
        $status = PostStatus::all();
        foreach ($status as $s){
            $select->addOption($s->name)
                    ->setValue($s->id);
        }
        $this->add(self::ELEMENT_SUBMIT, 'postSubmit');
    }
}
?>
